/* 弹出菜单 */
.b3-menu {
  background-color: var(--custom-popover-function-menu-background-color);
}
.b3-menu:not(.b3-menu--fullscreen) {
  padding: var(--custom-popover-menu-padding-width);
}
.b3-menu .b3-menu__title {
  background-color: transparent;
}
.b3-menu .b3-menu__items {
  /* 菜单项组 */
  padding: 0;
}
.b3-menu .b3-menu__items .b3-chips .b3-chip {
  outline: 1px solid currentColor;
}
.b3-menu .b3-menu__item {
  /* 菜单项 */
  background-color: transparent;
}
.b3-menu .b3-menu__item.b3-menu__item--current {
  /* 鼠标悬停菜单项 */
  background-color: var(--b3-theme-background-light) !important;
}
.b3-menu .b3-menu__item > .b3-menu__submenu {
  /* 子菜单 */
  background-color: var(--custom-popover-function-menu-background-color);
  padding: var(--custom-popover-menu-padding-width);
}
.b3-menu .b3-menu__item .b3-menu__accelerator {
  /* 输入框后面的捷径提示 */
  line-height: normal;
  align-self: center;
}
.b3-menu .b3-menu__item .b3-menu__action:hover {
  /* 菜单按钮控件 */
}
.b3-menu .b3-menu__item .b3-menu__icon.fn__a {
  width: 8px;
  height: 8px;
  padding: 4px;
  border-radius: 8px;
}
.b3-menu .b3-menu__item .b3-menu__icon.fn__a:hover {
  /* 菜单按钮控件 */
  color: var(--b3-theme-surface);
  background-color: var(--b3-theme-on-surface);
}
.b3-menu .b3-menu__item .b3-chip {
  outline: 1px solid currentColor;
  margin: 3px;
}
.b3-menu .b3-menu__separator {
  /* 菜单分割线 */
  height: 2px;
  background-color: var(--custom-popover-menu-separator-color);
}
.b3-menu input.b3-text-field {
  /* 输入框 */
  min-width: var(--custom-popover-menu-input-min-width);
}
.b3-menu input.b3-text-field.b3-form__icon-input {
  min-width: unset;
}
.b3-menu textarea.b3-text-field {
  /* 输入区域 */
  min-width: var(--custom-popover-menu-textarea-min-width);
}
.protyle-util .protyle-font .b3-color__square[data-type=color] {
  /* 字体颜色 */
  border-radius: 100%;
}
.protyle-util .protyle-font .b3-color__square[data-type=backgroundColor] {
  /* 背景颜色 */
  border-radius: unset;
}
.b3-list {
  /* REF: [第一个子元素在未超过父元素高度的情况下设置margin-top导致出现竖向滚动条的问题_Andrasen的博客-CSDN博客](https://blog.csdn.net/Andrasen/article/details/105676175) */
  padding: var(--custom-popover-menu-padding-width);
  background-color: transparent;
  backdrop-filter: none;
  outline: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--custom-popover-menu-outline-color);
  overflow-x: visible;
  /* 多层列表 */
}
.b3-list .b3-list {
  padding: unset;
  outline: unset;
}
.b3-list .b3-list-item {
  /* 菜单项 */
  margin: 0 !important;
  border-radius: var(--custom-border-radius);
}
.b3-list.protyle-hint {
  width: var(--custom-popover-menu-width) !important;
}
.b3-list.protyle-hint > div {
  overflow: unset !important;
}
.b3-list.protyle-hint .b3-list-item {
  width: 100% !important;
}
.b3-list.b3-menu.hint--menu,
.b3-list.protyle-hint,
.b3-list#searchHistoryList,
.b3-list#replaceHistoryList,
.b3-list#menu {
  background-color: var(--custom-popover-function-menu-background-color) !important;
  box-sizing: border-box;
}
.b3-list.hint--menu.protyle-hint {
  max-height: unset !important;
}
.b3-list.hint--menu.protyle-hint > div {
  /* '/' 菜单 */
  column-count: 4;
  column-gap: 1em;
  column-rule: var(--custom-list-guides-line-width) solid var(--b3-border-color);
}
.b3-list.hint--menu.protyle-hint > div > .b3-list-item {
  width: 100% !important;
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator {
  /* 分割线 */
  background-color: var(--b3-theme-on-surface);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:first-of-type + button *:is(.b3-list-item__graphic, .b3-list-item__text) {
  /* 一级子标题 */
  color: var(--custom-h1-color);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:first-of-type + button + button *:is(.b3-list-item__graphic, .b3-list-item__text) {
  /* 二级子标题 */
  color: var(--custom-h2-color);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:first-of-type + button + button + button *:is(.b3-list-item__graphic, .b3-list-item__text) {
  /* 三级子标题 */
  color: var(--custom-h3-color);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:first-of-type + button + button + button + button *:is(.b3-list-item__graphic, .b3-list-item__text) {
  /* 四级子标题 */
  color: var(--custom-h4-color);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:first-of-type + button + button + button + button + button *:is(.b3-list-item__graphic, .b3-list-item__text) {
  /* 五级子标题 */
  color: var(--custom-h5-color);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:first-of-type + button + button + button + button + button + button *:is(.b3-list-item__graphic, .b3-list-item__text) {
  /* 六级子标题 */
  color: var(--custom-h6-color);
}
.b3-list.hint--menu.protyle-hint > div > div.b3-menu__separator:nth-of-type(4) {
  /* 第4条分割线 */
  display: none;
}
.b3-list.hint--menu > .emojis {
  /* 表情菜单 */
  /* REF https: //github.com/siyuan-note/siyuan/issues/4575#issuecomment-1152490468 */
  column-span: all;
}
.b3-list:not(ul) .b3-list-item,
.b3-list.b3-tab-bar .b3-list-item,
.sy__backlink .b3-list .b3-list-item,
.b3-dialog__container .b3-list .b3-list-item,
#historyContainer .b3-list .b3-list-item {
  /* padding-top: var(--custom-popover-menu-margin-width); */
  /* border-bottom: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--b3-theme-on-surface); */
  margin: var(--custom-popover-menu-margin-width) 0 !important;
  border-radius: var(--custom-border-radius);
  outline: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--custom-popover-menu-outline-color);
}
.b3-list:not(ul) .b3-list-item:first-child,
.b3-list.b3-tab-bar .b3-list-item:first-child,
.sy__backlink .b3-list .b3-list-item:first-child,
.b3-dialog__container .b3-list .b3-list-item:first-child,
#historyContainer .b3-list .b3-list-item:first-child {
  /* 补偿第一项 */
  margin-top: 0 !important;
}
.b3-list:not(ul) .b3-list-item:last-child:not(.fn_none),
.b3-list.b3-tab-bar .b3-list-item:last-child:not(.fn_none),
.sy__backlink .b3-list .b3-list-item:last-child:not(.fn_none),
.b3-dialog__container .b3-list .b3-list-item:last-child:not(.fn_none),
#historyContainer .b3-list .b3-list-item:last-child:not(.fn_none) {
  /* 补偿最后一项 */
  margin-bottom: 0 !important;
}
.b3-list:not(ul) .b3-list-itembutton,
.b3-list.b3-tab-bar .b3-list-itembutton,
.sy__backlink .b3-list .b3-list-itembutton,
.b3-dialog__container .b3-list .b3-list-itembutton,
#historyContainer .b3-list .b3-list-itembutton {
  margin: var(--custom-popover-menu-margin-width) auto !important;
}
.b3-list:not(ul) .b3-list-item .b3-list-item__meta:not(.fn__flex),
.b3-list.b3-tab-bar .b3-list-item .b3-list-item__meta:not(.fn__flex),
.sy__backlink .b3-list .b3-list-item .b3-list-item__meta:not(.fn__flex),
.b3-dialog__container .b3-list .b3-list-item .b3-list-item__meta:not(.fn__flex),
#historyContainer .b3-list .b3-list-item .b3-list-item__meta:not(.fn__flex) {
  /* 文档可读路径 */
  color: var(--custom-popover-menu-path-color);
  margin: 0;
  border: 0;
  padding: 0;
}
.b3-list:not(ul) .b3-list-item .b3-list-item__meta.fn__flex,
.b3-list.b3-tab-bar .b3-list-item .b3-list-item__meta.fn__flex,
.sy__backlink .b3-list .b3-list-item .b3-list-item__meta.fn__flex,
.b3-dialog__container .b3-list .b3-list-item .b3-list-item__meta.fn__flex,
#historyContainer .b3-list .b3-list-item .b3-list-item__meta.fn__flex {
  color: var(--custom-popover-menu-attribute-color);
}
.b3-list:not(ul) .b3-list-item .b3-list-item__meta.fn__flex,
.b3-list.b3-tab-bar .b3-list-item .b3-list-item__meta.fn__flex,
.sy__backlink .b3-list .b3-list-item .b3-list-item__meta.fn__flex,
.b3-dialog__container .b3-list .b3-list-item .b3-list-item__meta.fn__flex,
#historyContainer .b3-list .b3-list-item .b3-list-item__meta.fn__flex {
  padding: 0.5em;
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-item {
  /* padding-top: var(--custom-popover-menu-margin-width); */
  /* border-bottom: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--b3-theme-on-surface); */
  margin: var(--custom-popover-menu-margin-width) 0 !important;
  border-radius: var(--custom-border-radius);
  outline: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--custom-popover-menu-outline-color);
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-item:first-child {
  /* 补偿第一项 */
  margin-top: 0 !important;
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-item:last-child:not(.fn_none) {
  /* 补偿最后一项 */
  margin-bottom: 0 !important;
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-itembutton {
  margin: var(--custom-popover-menu-margin-width) auto !important;
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-item .b3-list-item__meta:not(.fn__flex) {
  /* 文档可读路径 */
  color: var(--custom-popover-menu-path-color);
  margin: 0;
  border: 0;
  padding: 0;
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-item .b3-list-item__meta.fn__flex {
  color: var(--custom-popover-menu-attribute-color);
}
.b3-list.search__list > .b3-list-item + div:not(.b3-list-item) .b3-list-item .b3-list-item__meta.fn__flex {
  padding: 0.5em;
}
#historyContainer .b3-list {
  outline: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--custom-popover-menu-outline-color);
  padding-bottom: 0 !important;
}
#historyContainer .b3-list > .b3-list-item:hover {
  background-color: var(--b3-list-hover);
}
#historyContainer .b3-list > .b3-list-item.b3-list-item--focus {
  outline-color: var(--custom-popover-menu-focus-outline-color);
}
#historyContainer .b3-list > .b3-list-item.b3-list-item--hide-action:not(:hover) .b3-list-item__action {
  /* 占空间并隐藏元素 */
  display: flex;
  visibility: hidden;
}
#searchPanel {
  /* REF: [第一个子元素在未超过父元素高度的情况下设置margin-top导致出现竖向滚动条的问题_Andrasen的博客-CSDN博客](https://blog.csdn.net/Andrasen/article/details/105676175) */
  padding: var(--custom-popover-menu-padding-width);
  background-color: transparent;
  backdrop-filter: none;
  outline: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--custom-popover-menu-outline-color);
  overflow-x: visible;
}
#searchPanel .b3-list-item {
  /* padding-top: var(--custom-popover-menu-margin-width); */
  /* border-bottom: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--b3-theme-on-surface); */
  margin: var(--custom-popover-menu-margin-width) 0 !important;
  border-radius: var(--custom-border-radius);
  outline: var(--custom-popover-menu-outline-width) var(--custom-popover-menu-outline-style) var(--custom-popover-menu-outline-color);
}
#searchPanel .b3-list-item:first-child {
  /* 补偿第一项 */
  margin-top: 0 !important;
}
#searchPanel .b3-list-item:last-child:not(.fn_none) {
  /* 补偿最后一项 */
  margin-bottom: 0 !important;
}
#searchPanel .b3-list-itembutton {
  margin: var(--custom-popover-menu-margin-width) auto !important;
}
#searchPanel .b3-list-item .b3-list-item__meta:not(.fn__flex) {
  /* 文档可读路径 */
  color: var(--custom-popover-menu-path-color);
  margin: 0;
  border: 0;
  padding: 0;
}
#searchPanel .b3-list-item .b3-list-item__meta.fn__flex {
  color: var(--custom-popover-menu-attribute-color);
}
#searchPanel .b3-list-item .b3-list-item__meta.fn__flex {
  padding: 0.5em;
}
.b3-list-item mark:not(:empty),
.protyle-wysiwyg [data-node-id] span.def--mark:not(:empty),
.protyle-wysiwyg [data-node-id] span[data-type~=search-mark]:not(:empty) {
  margin: 0 0.25em;
  border: 0;
  padding: 0 0.125em;
  background-color: var(--custom-matched-keyword-background-color);
  outline-width: var(--custom-popover-menu-outline-width);
}
.b3-list-item mark:not(:empty):not(.def--mark),
.protyle-wysiwyg [data-node-id] span.def--mark:not(:empty):not(.def--mark),
.protyle-wysiwyg [data-node-id] span[data-type~=search-mark]:not(:empty):not(.def--mark) {
  outline-style: var(--custom-popover-menu-outline-style);
}
.b3-list-item mark:not(:empty):is(.def--mark),
.protyle-wysiwyg [data-node-id] span.def--mark:not(:empty):is(.def--mark),
.protyle-wysiwyg [data-node-id] span[data-type~=search-mark]:not(:empty):is(.def--mark) {
  border-width: var(--custom-popover-menu-outline-width);
  border-style: var(--custom-popover-menu-outline-style);
}
